package com.changepic.downloadImageAsync;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.SeekBar;

import com.changepic.R;

public class DownLoadImageAsyncActivity extends Activity{
	private Button downloadButton;
	private ImageView imageView;
	private SeekBar seekBar;
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.downloadlayout);
		downloadButton = (Button)findViewById(R.id.startdownload);
		imageView = (ImageView)findViewById(R.id.imagedownload);
		seekBar = (SeekBar)findViewById(R.id.seekbar);
		downloadButton.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				String url = "http://www.people.com.cn/mediafile/pic/20111216/70/16178058845418824754.jpg";
					DownLoadTask task = new DownLoadTask(imageView,seekBar,DownLoadImageAsyncActivity.this);
					task.execute(url);
			}
		});
	}
	
}
